package indi.h.filefilter.filters;

import indi.h.filefilter.anaysis.Anaysis;
import indi.h.filefilter.lists.NRPArrayList;
import indi.h.filefilter.lists.NRPList;

public class BasicFilters implements Filter {
	private NRPList<Filter> filters;
	private Integer fr_size;

	public BasicFilters() {
		super();
		this.filters = new NRPArrayList<>();
	}

	public BasicFilters(NRPList<Filter> filters) {
		super();
		this.filters = filters;
	}

	@Override
	public boolean filter(Anaysis.FileMessage af) {
		// TODO Auto-generated method stub
		for (int i = 0; i < filters.size(); i++) {
			Filter f = filters.get(i);
			fr_size = i;
			if (!f.filter(af)) {
				return false;
			}
		}
		return true;
	}

	@Override
	public boolean isFilter() {
		// TODO Auto-generated method stub
		return true;
	}

	public void setFilters(NRPList<Filter> filters) {
		this.filters = filters;
	}

	public void setFilter(Filter filter) {
		this.filters.put(filter);
	}

	@Override
	public FilterR filterR() {
		// TODO Auto-generated method stub
		return this.filters.get(fr_size).filterR();
	}

	@Override
	public Object getCF() {
		// TODO Auto-generated method stub
		return null;
	}

}
